		var expressP, expressC, expressD, expressArea, areaCont;
		var arrow = " <font>&gt;</font> ";

		/*初始化一级目录*/
		var model = $("#model").val();
		var arr0 = [];
		var arr1 = [];
		var arr2 = [];

		function intProvince() {
			var arr = [];
			$.get('/slim1/index.php/home/getcate',function($data){
				// alert($data[0]);return false;
				if($data){
					$.each($data[0], function(i, obj) {  
						arr0.push(i);
						arr0.push(obj.name);
						
					}); 
					$.each($data[1], function(i, obj) {  
						arr1.push(i);
						arr1.push(obj.name);
						
					});
					$.each($data[2], function(i, obj) {  
						arr2.push(i);
						arr2.push(obj.name);
						
					});  
					
					areaCont = "";
					for (var m=0,j=1,i=0;m<arr0.length,i<arr0.length,j<arr0.length; i=i+2,j=j+2,m++) {
						areaCont += '<li onClick="selectP(' + arr0[i] + ',' + m + ');"><a href="javascript:void(0)">' + arr0[j] + '</a></li>';
					}
					
					$("#sort1").html(areaCont);
					
				}
			});

		}
		intProvince();

		/*选择一级目录*/
		function selectP(p,m) {
				
				$("#sort1 li").eq(m).addClass("active").siblings("li").removeClass("active");
				expressP = $("#sort1 li").eq(m).children().text();
				$("#selectedSort").html(expressP);
				
				if(arr1){
							
					areaCont = "";
					for (var m=0,j=1,i=0;m<arr1.length,i<arr1.length,j<arr1.length; i=i+2,j=j+2,m++) {
						areaCont += '<li onClick="selectC(' + arr1[i] + ',' + m + ',\''+expressP+'\');"><a href="javascript:void(0)">' + arr1[j] + '</a></li>';
					}
					$("#sort2").html(areaCont).show();
					$("#sort3").hide();
					$("#sort4").hide();
					
				}else{
					$("#sort2").hide();
					//$("#sort2 li").eq(c).addClass("active").siblings("li").removeClass("active");
				}
				
		}

		/*选择二级目录*/
		function selectC(p,c,t) {
			expressC = $("#sort2 li").eq(c).children().text();			
			expressC = t+'/' + expressC ;
			$("#selectedSort").html(expressC);
			$("#sort2 li").eq(c).addClass("active").siblings("li").removeClass("active");

			
				
				if(arr2){
					
					
					var t = $("#sort2 li").eq(0).children().text();
					if(t == 'Decathlon/迪卡侬'){
						return false;
					}

					areaCont = "";
//					expressC = "";
					for (var m=0,j=1,i=0;m<arr2.length,i<arr2.length,j<arr2.length; m++,i=i+2,j=j+2) {
						areaCont += '<li onClick="selectD(' + arr2[i] + ',' + m + ',\''+expressC+'\');"><a href="javascript:void(0)">' + arr2[j] + '</a></li>';
					}

					
					$("#sort3").html(areaCont).show();
					$("#sort4").hide();
					//expressC = expressP + arrow + arr[j];
					//$("#selectedSort").html(expressC);
					
				}else{
					$("#sort3").html(areaCont).hide();
					
				}
			
		}

		/*选择三级目录*/
		function selectD(p,c,t) {
			$("#sort3 li").eq(c).addClass("active").siblings("li").removeClass("active");
			expressD = $("#sort3 li").eq(c).children().text();
			expressD = t + '/' + expressD ;
			$("#selectedSort").html(expressD);
			var arr = [];
			$.post('/slim1/index.php/home/result',{"cid":p}, function($data){
				
				if($data){
					
					$.each($data, function(i, obj) {  
						arr.push(i);
						arr.push(obj.name);
					}); 

					var t = $("#sort3 li").eq(0).children().text();
					if(t == 'Decathlon/迪卡侬'){
						return false;
					}

					areaCont = "";
//					expressC = "";
					for (var m=0,j=1,i=0;m<arr.length,i<arr.length,j<arr.length; m++,i=i+2,j=j+2) {
						areaCont += '<li onClick="selectE(' + arr[i] + ',' + m + ');"><a href="javascript:void(0)">' + arr[j] + '</a></li>';
					}
					$("#sort4").html(areaCont).show();
					$("#sort5").hide();
					$a = $('#sort4').css('display');
					// alert($("#sort4").offset().left);
					if($a !== 'none'){	
						$("html,#sort0").animate({scrollLeft:$("#sort4").offset().left},1000);
						//alert($a);	
					}

				}else{
					$("#sort4").html(areaCont).hide();
				}
			});

		}
		
		/*选择四级目录*/
		function selectE(p,c) {
			$("#sort4 li").eq(c).addClass("active").siblings("li").removeClass("active");
			expressD = $("#sort4 li").eq(c).children().text();
			expressD = '/' + expressD ;
			$("#selectedSort").append(expressD);
		}

		/*点击下一步*/
		$("#releaseBtn").click(function() {
			// var releaseS = $(this).prop("disabled");
			// if (releaseS == false) {//未被禁用
			// 	//location.href = "商品发布-详细信息.html";//跳转到下一页
			// }
			location.href= '/slim1/index.php/publish';
		});


